package com.jpetrinet.core;

import java.util.HashMap;
import java.util.Map;

import com.jpetrinet.core.Object;
import com.jpetrinet.core.exceptions.ObjectAlreadyExistsException;

public class Page extends Object {

	public Page(String id) {
		this.setId(id);
	}
	
	Map<String, Object> objects = new HashMap<String, Object>();

	public Map<String, Object> getObjects() {
		return objects;
	}

	public void addObject(Object object) throws ObjectAlreadyExistsException {
		if(this.objects.containsKey(object.getId()))
			throw new ObjectAlreadyExistsException();
		
		this.objects.put(object.getId(), object);
	}
	
}
